<?php
$servername="127.0.0.1";
$username="root";
$password="";
$dbname="stu_result";
// 创建链接
$conn = new mysqli($servername, $username, $password, $dbname);
//设置字符集
@mysqli_set_charset($conn, utf8);
// 检测连接
//获取连接错误信息
if ($conn ->connect_error){
	die("连接失败:".$conn ->connect_error);
	}